import 'package:built_collection/built_collection.dart';
import 'package:equatable/equatable.dart';
import 'package:mobile_app.home.core/custom_lexical_item_editing_page/domain/entities/custom_lexical_item_use_case_input.dart';

class CustomLexicalItemInput extends Equatable {
  const CustomLexicalItemInput({
    required this.title,
    required this.translation,
    required this.transcription,
    required this.titleValid,
    required this.translationValid,
    required this.useCaseInputs,
  });

  final String title;
  final String translation;
  final String transcription;
  final bool titleValid;
  final bool translationValid;
  final BuiltList<CustomLexicalItemUseCaseInput> useCaseInputs;

  @override
  List<Object?> get props {
    return [
      title,
      translation,
      transcription,
      titleValid,
      translationValid,
      useCaseInputs,
    ];
  }

  CustomLexicalItemInput copyWith({
    String Function()? title,
    String Function()? translation,
    String Function()? transcription,
    bool Function()? titleValid,
    bool Function()? translationValid,
    BuiltList<CustomLexicalItemUseCaseInput> Function()? useCaseInputs,
  }) {
    return CustomLexicalItemInput(
      title: title == null ? this.title : title(),
      translation: translation == null ? this.translation : translation(),
      transcription: transcription == null ? this.transcription : transcription(),
      titleValid: titleValid == null ? this.titleValid : titleValid(),
      translationValid: translationValid == null ? this.translationValid : translationValid(),
      useCaseInputs: useCaseInputs == null ? this.useCaseInputs : useCaseInputs(),
    );
  }
}
